package org.lgiavedoni.android.franq.core.prediction.rule;

import java.util.List;

import lombok.Data;
import lombok.EqualsAndHashCode;

import org.lgiavedoni.android.franq.core.dao.DaoObject;
import org.lgiavedoni.android.franq.core.prediction.Prediction;

@Data
@EqualsAndHashCode(callSuper=true)
public abstract class PredictionRule extends DaoObject {

	// Number of occurrences
	private int occurrence = 0;
	private int noOccurrence = 0;
	private final boolean validateForUser = false;

	public abstract List<Prediction> generatePredictions();

	public int getCertainty() {
		// TODO implement this function
		return occurrence != 0 ? ((occurrence - noOccurrence) * 100) / occurrence : 0;
	}
	
	public void addOccurrence() {
		occurrence++;
	}

	public void addNoOccurrence() {
		noOccurrence++;
	}
}
